import axiosServer from "@/utils/request";

/**
 * 冲级活动-规则查询
 * @returns 
 */
export const upgradeControlFind = () => {
    return axiosServer({
        method: "get",
        url: "/activityControl/loadByRoute",
    });
};
/**
 * 冲级活动-规则修改
 * @param {*} id 
 * @param {*} rule 规则
 * @param {*} startTime 开始时间
 * @param {*} endTime  结束时间
 * @param {*} residueQuota 总额度
 * @param {*} quota 已发放额度
 * @param {*} probability 概率
 * @returns 
 */
export const upgradeControlUpdate = (id, rule, startTime, endTime, residueQuota, quota, probability) => {
    return axiosServer({
        method: "post",
        url: "/upgradeControl/update",
        data: {
            id, rule, startTime, endTime, residueQuota, quota, probability
        }
    });
};
/**
 * 改变用户密码
 * @param {*} password  旧密码
 * @param {*} newPassword  新密码
 * @returns 
 */
export const changeUserPassword = (password, newPassword) => {
    return axiosServer({
        method: "post",
        url: "/user/updateAdminPassword",
        params: { password, newPassword }
    });
};